import request from '@/utils/request'

// 查询学员报名记录列表
export function listStu_record(query) {
    return request({
        url: '/pv/stu_record/list',
        method: 'get',
        params: query
    })
}

// 导出学员报名记录列表
export function exportStudentList(classId,query) {
  return request({
    url: '/pv/stu_record/export/'+classId,
    method: 'post',
    params: query
  })
}

// 根据培训班编号查询该培训班下的学生
export function studentList(classId,query) {
  return request({
    url: '/pv/stu_record/student-list/'+classId,
    method: 'get',
    params: query
  })
}

// 查询学员报名记录详细
export function getStu_record(id) {
    return request({
        url: '/pv/stu_record/' + id,
        method: 'get'
    })
}

// 新增学员报名记录
export function addStu_record(data) {
    return request({
        url: '/pv/stu_record',
        method: 'post',
        data: data
    })
}

// 修改学员报名记录
export function updateStu_record(data) {
    return request({
        url: '/pv/stu_record',
        method: 'put',
        data: data
    })
}

// 批量颁证 ids
export function complete_cert_ids(cert,ids) {
  return request({
    url: '/pv/stu_record/complete-cert-ids/' + ids,
    method: 'put',
    data: cert
  })
}

// 批量颁证 ids
export function complete_cert_query(cert,query) {
  return request({
    url: '/pv/stu_record/complete-cert-query/',
    method: 'put',
    params: query,
    data: cert
  })
}

// 删除学员报名记录
export function delStu_record(id) {
    return request({
        url: '/pv/stu_record/' + id,
        method: 'delete'
    })
}

export function get_not_in_class_student_list(classId) {
    return request({
        url: '/pv/stu_record/get-not-in-class-student-list/' + classId,
        method: 'get'
    })
}

export function add_more_student(classId,studentIds){
  return request({
    url: '/pv/stu_record/add-more-student/' + classId,
    method: 'post',
    data: studentIds
  })
}


export function getRecord_by_class_user(classId,userId){
  return request({
    url: `/pv/stu_record/getRecord-by-clazz-user/${classId}/${userId}`,
    method: 'get'
  })
}
